/*
 * OrderDetailInfoListItem.java
 * business
 *
 * Created by SunDing on 2016/9/9.
 *
 * Copyright (c) 2016年 yidiandao. All rights reserved.
 */

package com.yidiandao.business.ui.widget.listview.displaylistitem;

import android.content.Context;

import com.yidiandao.business.R;
import com.yidiandao.business.data.response.OrderDetailResponse;
import com.yidiandao.business.ui.widget.listview.DisplayListItem;
import com.yidiandao.business.ui.widget.listview.viewholder.OrderDetailPayInfoHolder;
import com.yidiandao.business.utils.UIUtils;

/**
 * 订单详情 商品信息
 */
public class OrderDetailPayInfoListItem
        extends DisplayListItem<OrderDetailPayInfoHolder, OrderDetailResponse.Data> {

    public OrderDetailPayInfoListItem(OrderDetailResponse.Data s) {
        super(s);
    }

    @Override
    public void onShow(final Context context, OrderDetailPayInfoHolder holder) {
        //商品金额
        holder.mTvTotalValue.setText(
                UIUtils.getString(R.string.shopping_cart_value, data.getOrder().getGoodsAmount()));
        //配送费用
        holder.mTvTotalCarriage.setText(
                UIUtils.getString(
                        R.string.shopping_cart_carriage, data.getOrder().getShippingFee()));
        //实际支付
        holder.mTvTotalMoney.setText(
                UIUtils.getString(R.string.shopping_cart_value, data.getOrder().getOrderAmount()));
        //红包优惠
        holder.mTvRedPacket.setText(
                UIUtils.getString(R.string.shopping_cart_coupon, data.getOrder().getRedPaper()));
        //发票金额
        holder.mTvNvoice.setText(
                UIUtils.getString(R.string.shopping_cart_carriage, data.getOrder().getInvMoney()));
        //手续费
        holder.mTvCharge.setText(
                UIUtils.getString(R.string.shopping_cart_carriage, data.getOrder().getPayFee()));
        //优惠券
        holder.mTvCoupon.setText(
                UIUtils.getString(R.string.shopping_cart_coupon, data.getOrder().getCouponMoney()));
    }

    @Override
    public String getDisplayItemTag() {
        return OrderDetailPayInfoListItem.class.getSimpleName();
    }

    @Override
    public Class<OrderDetailPayInfoHolder> getViewHolderClazz() {
        return OrderDetailPayInfoHolder.class;
    }
}
